-- check_job
--
local main_ctx = main_ctx
local import = import
---@type behavior_ret
local bret = import('bt/bt_plugin/behavior3/behavior_ret')
---@type api
local api = import("api/api")


local M = {
    name = "check_job",
    type = "Condition",
    desc = "检查职业",
    args = {
        --{ name = "str", type = "string", desc = "变量描述" },
        {
            name = "nType",
            type = "enum",
            desc = "目标类型",
            options = {
                {
                    name = "猎人",
                    value = "猎人",
                },
                {
                    name = "剑客",
                    value = "剑客",
                },
            },
        },
    },
    input = {},
    output = {},
}

function M.run(node, env, value)
    -- node.args.str
    local job = main_ctx:c_job()
    local nType = node.args.nType
    if job == nType then
        return bret.SUCCESS
    end
    return bret.FAIL
end

return M
